<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改户信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-base_family_info-edit" th:object="${baseFamilyInfo}">
            <input name="fid" th:field="*{fid}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">行政村：</label>
                <div class="col-sm-8">
                    <select name="admVillage" class="form-control m-b" th:with="type=${@dict.getType('base_administration_village')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{admVillage}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">自然村：</label>
                <div class="col-sm-8">
                    <select name="natVillage" class="form-control m-b" th:with="type=${@dict.getType('base_nature_village')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{natVillage}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">户主姓名：</label>
                <div class="col-sm-8">
                    <input name="name" th:field="*{name}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">户联系电话：</label>
                <div class="col-sm-8">
                    <input name="phone" th:field="*{phone}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">人口数：</label>
                <div class="col-sm-8">
                    <input name="num" th:field="*{num}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">耕种面积：</label>
                <div class="col-sm-8">
                    <input name="area" th:field="*{area}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">户类别：</label>
                <div class="col-sm-8">
                    <select name="familyType" class="form-control m-b" th:with="type=${@dict.getType('base_family_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{familyType}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">户状态(0-有人 1-绝户)：</label>
                <div class="col-sm-8">
                    <input name="state" th:field="*{state}" class="form-control" type="text" required>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/base_family_info";
        $("#form-base_family_info-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-base_family_info-edit').serialize());
            }
        }
    </script>
</body>
</html>